package book_management.user.user;

import book_management.user.book.BookList;
import book_management.user.operation.IOperation;
import book_management.user.operation.impl.BorrowOperation;
import book_management.user.operation.impl.DisplayOperation;
import book_management.user.operation.impl.FindOperation;
import book_management.user.operation.impl.ReturnOperation;
import book_management.user.user.User;

public class NormalUser extends User {
    public NormalUser(String userName) {
        this.name=userName;
        //规定了普通用户的操作权限
        operations=new IOperation[]{
                new DisplayOperation(),
                new FindOperation(),
                new BorrowOperation(),
                new ReturnOperation()
        };
    }


    //普通用户类是需要外部来调用的
    @Override
    public int menu() {
        System.out.println("=========================");
        System.out.println("欢迎"+this.name+"登录财大图书馆借阅系统");
        System.out.println("1.显示当前书籍列表");
        System.out.println("2.查询书籍");
        System.out.println("3.借阅书籍");
        System.out.println("4.归还书籍");
        System.out.println("-1.退出");
        System.out.println("请输入您的选择");
        int choice= scanner.nextInt();
        //切记不要在这关闭scanner，当用户输入-1退出系统时再关闭
        return choice;
    }
}
